package org.springblade.modules.admin.vo.plan;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springblade.modules.admin.enums.MaintainPlanContentEnum;
import org.springblade.modules.admin.enums.TaskStatusEnum;

import java.math.BigDecimal;
import java.util.Date;

/**
 * @Description 救援工单详情
 * @Author ysq
 * @Date 2024/3/12
 */
@Data
public class PlanRescueDetailVO {

	@ApiModelProperty(value = "工单id")
	private Long planId;

	@ApiModelProperty(value = "项目id")
	private Long buildingId;

	@ApiModelProperty(value = "电梯id")
	private Long elevatorId;

	@ApiModelProperty(value = "电梯位置")
	private String address;

	@ApiModelProperty(value = "报警人名称")
	private String name;

	@ApiModelProperty(value = "报警人电话")
	private String phone;

	@ApiModelProperty(value = "报警类型 0-困人，1-伤人")
	private String trapType;

	@ApiModelProperty(value = "报警备注")
	private String trapDesc;

	@ApiModelProperty(value = "报警楼层")
	private String floor;

	@ApiModelProperty(value = "报警时间")
	private Date createTime;

	@ApiModelProperty(value = "工单状态")
	private Integer status;

	@ApiModelProperty(value = "工单状态描述")
	private String statusName;

	@ApiModelProperty(value = "项目名称")
	private String buildingName;

	@ApiModelProperty(value = "项目纬度")
	private BigDecimal latitude;

	@ApiModelProperty(value = "项目经度")
	private BigDecimal longitude;

	@ApiModelProperty(value = "项目要求救援到达时间")
	private Integer rescueUseTime;

	@ApiModelProperty(value = "状态,-1：未订阅,0：离线,1：在线,2: 通话中")
	private Integer deviceStatus;

	public String getStatusName() {
		if (status != null) {
			return TaskStatusEnum.getTaskName(MaintainPlanContentEnum.MAINTAIN_KR.getId(), this.status);
		}
		return statusName;
	}
}
